#include <stdio.h>
#include <pthread.h>

void* do_thread(void *arg) {
  printf("thread start\n");
  pthread_exit(NULL); // 线程退出
}
int main(int argc, char const *argv[])
{
  // 创建线程
  pthread_t thread; 
  int tid = pthread_create(&thread, NULL, do_thread, NULL);
  printf("tid = %d\n", tid);
  pthread_join(thread, NULL); // 等待子线程结束
  return 0;
}
